#!/usr/bin/expect

spawn build/bin/observer -f etc/observer.ini -P cli 
expect "miniob >"

send "drop table t;\r"
expect "miniob >"
send "create table t(id int, name char, price float);\r"
expect "miniob >"
send "insert into t values(1,'vasf',1.1)\r"
expect "miniob >"
send "insert into t values(2,'ddfs',10.9)\r"
expect "miniob >"
send "insert into t values(3,'fsgf',12.0)\r"
expect "miniob >"

send "select count(*) from t;\r"
expect "miniob >"
send "select count(id) from t;\r"
expect "miniob >"
send "select min(id) from t;\r"
expect "miniob >"
send "select min(name) from t;\r"
expect "miniob >"
send "select max(id) from t;\r"
expect "miniob >"
send "select max(name) from t;\r"
expect "miniob >"
send "select avg(id) from t;\r"
expect "miniob >"
send "select avg(price) from t;\r"
expect "miniob >"
send "select avg(price), max(id), max(name) from t;\r"
expect "miniob >"

send "select count(*,id) from t;\r"
expect "miniob >"

send "select count() from t;\r"
expect "miniob >"

send "select count(not_filed) from t;\r"
expect "miniob >"


interact